<div class="tableinfo">
    <div class="tableHeader">
        <p>Danh Sách Thông Báo</p>
    </div>
    
    
    <table border ="0" cellspacing ="0" cellpadding ="0">
        <tr style="background: silver; font-weight: bold;">
         
            <td>Tiêu đề </td>
            <td>Ngày</td>
            <td >Ghi Chú</td>
                
        </tr>
        
        <?php 
            include "../controller/load_ds_thongbao.php";
            
            while ($row = mysql_fetch_assoc($dsthongbao)){
               
            $idthongbao = $row['id'];
            echo " <tr>
         
            <td><a href='../view/hienthi_thongbao.php?id=$idthongbao' style='font-size: medium;'>".$row['TieuDe']."</a></td>
            <td>".$row['NgayDang']."</td>
            <td>".$row['GhiChu']."</td>
            </tr>" ;

            }
            
        ?>
    </table>

    <ul class="phantrang">
                <?php
                   //echo $so; 
                  if($page >1){
                    $sau = $vitri + $hienthi;
                    $truoc = $vitri - $hienthi;
                    $tranght= ($vitri/$hienthi)+1;
    
                    //nut pre                
                    if($tranght !=1){
                        echo "<li><a href='../view/dsthongbao.php?vitri=".$truoc."'>Trước</a></li>";
                    }
                    
                    //so trang
                    for($i=1; $i<=$page; $i++ ){
                        if($tranght != $i){
                            echo "<li><a href='../view/dsthongbao.php?vitri=".$hienthi*($i-1)."'>$i</a></li>"; 
                        }else{
                            echo "<li class='hientai'><a href=''>$i</a></li>";
                        } 
                    }
                    
                    
                    //nut next
                    if($tranght != $page){
                        echo "<li><a href='../view/dsthongbao.php?vitri=".$sau."'>Sau</a></li>";
                    }
                  }  
                ?>
                 
            </ul>           
</div>
